package org.swan.web.exception;

import lombok.Data;

@Data
public class BusinessCode {

    public static final BusinessCode PARAMETER_INVALID = new BusinessCode(100, "Parameter invalid.");
    public static final BusinessCode VALIDATION_PATTERN_INVALID = new BusinessCode(101, "Validation pattern invalid.");
    public static final BusinessCode UNMATCHED_METHOD = new BusinessCode(102, "Unmatched method.");
    public static final BusinessCode UNKNOWN_BIT_MODE = new BusinessCode(110, "Unknown bit mod0e appear.");
    public static final BusinessCode UNKNOWN_ORG_TYPE = new BusinessCode(111, "Unknown OrgType appear.");
    public static final BusinessCode ENCODE_ISNT_SUPPORTED = new BusinessCode(112, "Encode algorithm isn't supported.");
    public static final BusinessCode DATA_MISSING = new BusinessCode(113, "Some data is missing.");

    public static final BusinessCode NAMESPACE_DO_NOT_EXIST = new BusinessCode(10000,"Namespace don't exist.");
    public static final BusinessCode PERMISSION_DO_NOT_EXIST = new BusinessCode(10100,"Permission don't exist.");
    public static final BusinessCode ROLE_DO_NOT_EXIST = new BusinessCode(10200,"Role don't exist.");
    public static final BusinessCode ROLE_PERMISSION_DO_NOT_EXIST = new BusinessCode(10201,"The relation between the role and permission don't exits.");
    public static final BusinessCode USER_DO_NOT_EXIST = new BusinessCode(10300,"User don't exist.");
    public static final BusinessCode USER_ROLE_DO_NOT_EXIST = new BusinessCode(10301,"The relation between the user and role don't exits.");
    public static final BusinessCode USER_EXTENSION_DO_NOT_EXIST = new BusinessCode(10400,"User extension id don't exist.");


    public BusinessCode(int code, String description) {
        this.code = code;
        this.description = description;
    }

    private int code;
    private String description;
}
